use std::{sync::RwLock, thread};

fn main() {
    let m = RwLock::new(5);
    let c = thread::spawn(move || {
        *m.write().unwrap() += 1;
        *m.read().unwrap()
    });

    let updated = c.join().unwrap();
    println!("{:?}", updated);
}
